<template>
  <div>
    <h1>组件传值</h1>
    <my-emit :post="str" @son='mychg'></my-emit>
    <hr>
    <my-on></my-on>
  </div>
</template>

<script>
import MyEmit from '../components/my-emit.vue'
import MyOn from '../components/my-on.vue'
export default {
  name: 'chp-08',
  components: {
    'my-emit': MyEmit,
    'my-on': MyOn
  },
  data () {
    return {
      str: '父类--的值'
    }
  },
  methods: {
    mychg (msg) {
      this.str = msg
    }
  }
}
</script>

<style lang="css" scoped>
</style>
